{% extends 'base.html' %}
{% block content %}
    <form class="form-horizontal" role="form" method="post" action="" >
        <fieldset >
            <legend>添加主机</legend>
            {% if error %}
                <div class="alert alert-danger">
                    {{ error }}
                </div>
            {% endif %}
            {% if msg %}
                <div class="alert alert-success">
                    {{ msg }}
                </div>
            {% endif %}
            <div class="form-group">
                <label for="ip" class="col-sm-2 control-label">IP<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="ip" name="ip" placeholder="IP">
                </div>
            </div>
            <div class="form-group">
                <label for="port" class="col-sm-2 control-label">Port<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="port" name="port" placeholder="Port">
                </div>
            </div>
            <div class="form-group">
                <label for="idc" class="col-sm-2 control-label">IDC<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <select name="idc" id="idc" class="form-control">
                        {% for idc in idcs %}
                        <option value="{{ idc.id }}">{{ idc.name }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-sm-4">
                    <a href="/addIDC/">添加IDC</a>
                    <a href="/showIDC/">删除IDC</a>
                </div>

            </div>
            <div class="form-group">
                <label for="comment" class="col-sm-2 control-label">备注<span style="color: red"></span></label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="comment" name="comment" placeholder="备注(最好是英文)">
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-4">
                    <button class="btn btn-primary">添加</button>
                </div>
            </div>
        </fieldset>
    </form>
{% endblock %}